
export function TreeData(data, value) {
  const arr = []
  data.forEach(itme => {
    if (itme.pid === value) {
      const children = TreeData(data, itme.id)

      if (children.length) {
        itme.children = children
      }
      arr.push(itme)
    }
  })
  return arr
}
